package com.tools.developer.common;

import android.app.Application;
import android.content.Context;

import com.tools.developer.util.Env;
import com.tools.developer.util.MyCrashHandler;
import com.tools.developer.util.SharedPrefHelper;

public class ToolsDeveloper extends Application {

	public static boolean cpu_screen_alarm = false;
	public static boolean screen_cpu_status = false;
	public static String screen_cpu_type;
	public static String screen_governor_type;
	public static String cur_scaling_governor;

	private static ToolsDeveloper sInstance;
	public static boolean isPad = false;
	/**
	 * tab跳转标示
	 */
	public String target_tab = "";

	// 单例模式中获取唯一的ExitApplication实例
	public static ToolsDeveloper getInstance() {
		if (null == sInstance) {
			sInstance = new ToolsDeveloper();
		}
		return sInstance;

	}

	/**
	 * 退出程序
	 * 
	 * @param c
	 */
	public void exit() {
		Context c = this.getApplicationContext();
		SharedPrefHelper.getInstanse(c).putExitFlag(true);
		android.os.Process.killProcess(android.os.Process.myPid());
		System.exit(0);

	}

	@Override
	public void onCreate() {
		sInstance = this;
		MyCrashHandler.getInstance().register((Context) this);

		isPad = Env.getScreenSizeIn(this.getApplicationContext()) > 6 ? true
				: false;
	}

}
